import type { AxiosInstance, AxiosRequestConfig } from 'axios';
import { BASE_URL } from './config';
import httpClient from './http-client';

export default class ApiBase {
  protected httpClient: AxiosInstance;
  protected config?: AxiosRequestConfig;
  constructor(axiosInstance?: AxiosInstance, config?: AxiosRequestConfig) {
    this.config = {
      baseURL: BASE_URL,
      ...config
    };
    this.httpClient = axiosInstance ?? httpClient;
  }
}
